package com.example.component;

import com.example.FlowContext;
import com.yomahub.liteflow.annotation.LiteflowComponent;
import com.yomahub.liteflow.annotation.LiteflowMethod;
import com.yomahub.liteflow.core.NodeComponent;
import com.yomahub.liteflow.enums.LiteFlowMethodEnum;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@LiteflowComponent
public class CacheCmp {
    @LiteflowMethod(value = LiteFlowMethodEnum.PROCESS, nodeId = "redisCacheOperator", nodeName = "Redis缓存结果")
    public void redisCacheOperator(NodeComponent bindCmp) {
        FlowContext contextBean = bindCmp.getContextBean(FlowContext.class);
        String key = contextBean.getDevice() + ":" + contextBean.getProductId();
        log.info("Redis缓存，key={}", key);
    }
}
